Update dependency dalli to v5.0.6 - #565
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
5.0.5→5.0.6Release Notes
petergoldstein/dalli (dalli)
v5.0.6Compare Source
==========
Performance:
Skip the cas-return flag on quiet
meta_setrequests (#1131)msresponse entirely, so the CAS requested by thecflag can never be read; sending it only added two bytes to every requestDalli::Client#multiblocks and the pipelined setterReduce allocations in
KeyRegularizerand multi-key request paths (#1120)KeyRegularizer#encodeinto separateneeds_encoding?andencodecalls so the common happy path avoids allocating an intermediate array for the two-element return valuemulti_get/multi_set/multi_deletecommand generation intoRequestFormatterto share its key-encoding helpersReduce allocations in
ResponseBufferpipelined getk parsing (#1117)process_single_getk_responsewas building a fresh array to return results alongside the updated offset; refactored to store the offset as the last element of the existing tokens array and pop it, saving one allocation per responseEnable frozen string literals in
RequestFormatter(#1118)get_multi_casbenchmark (562 MB → 550 MB total allocated)Reduce allocations in
ResponseProcessor#value_from_tokens(#1113)token[1..].to_iwas allocating a new string for every token parsed; replaced with in-placeslice!followed by a token reset to avoid poisoning subsequent token comparisonsget_multi_casworkloads (a hotspot for IdentityCache)Reduce allocations in common operation paths (#1111)
Symbol#nameoverSymbol#to_sto return a frozen string without allocation...) inClient#performandThreadsafe#requestto avoid splat array allocationmatch?inKeyRegularizer#encodeto avoidMatchDataobject allocationgetworkloadFix pathological memory behavior in
ResponseBuffer(#1114)compact_if_neededwas intended to reclaim memory by slicing off consumed bytes, butbuffer.byteslice(@​offset..)on an unfrozen string causes Ruby to allocate a hidden third string as the copy-on-write owner rather than freeing the originalread/read_nonblock, avoiding reallocation on each response readget_multi_casbenchmark over 10,000 iterationsResponseBuffer(#1115)Features:
delete_multinow returns the number of keys found and deleted (#1126)NF, so any response received before the terminator is a key that was not deletedRetryableNetworkError) network errors, so both paths behave consistently; the returned count is best-effort and may under-report if a network error triggers a retry, since keys deleted before the error are not recountedBug Fixes:
Raise instead of returning a truncated value when the peer closes mid-response (#1135)
IO#read(count)on a blocking socket accumulates across TCP chunks and hands back a shorter buffer (ornil) in only one case: the stream hit EOF. That short buffer was passed through as the response body, so a memcached restart, proxy drop, or load balancer timeout partway through a response could surface a truncated but still decodable value to the caller, indistinguishable from a real oneSocket#readfull, which enforces the same contractTear down the connection when a non-
StandardErroraborts a request (#1136)Async::StopandThread#killdescend fromExceptionrather thanStandardError, so the rescue clauses inProtocol::Base#requestnever saw them; a scheduler cancelling a fiber parked on a response read skippedcloseentirely, leaving the connection marked as having a request in progress with partial response bytes still unread on the wire, and returning that half-used client to the pool underconnection_poolProtocol::Base#requestnow closes in anensureunless the request ran to completion, andConnectionManager#closeperforms its state cleanup in anensureso a second cancellation landing inside@sock.closecannot leave the socket non-nil with the request still marked in progressDalli::DalliErrorandDalli::MarshalErrornow close the connection at the point of failure rather than at the start of the next request; those paths already left the request in progress andConnectionManager#confirm_ready!closed on the next call, so this changes when the close happens rather than adding oneFix
ResponseBuffercompaction logic (#1119)COMPACT_THRESHOLDwas removed in #1116 as apparently unused, but the constant was referenced by the compaction guard; its absence silently disabled buffer compactionString#bytesplice(backed bymemmove) for true in-place compactionMaintenance:
Scope
StrictWarningsto Dalli's own source (#1134)-wand prepends a hook toWarning.singleton_classthat turns warnings into failures, but that hook is global: a warning emitted while loading any third-party gem aborted the whole suite before a single test ranjson2.21.2's pure-Ruby generator (used on JRuby, where the C extension is unavailable) warnsmethod redefined; discarding old to_hashat require time, which took thejruby-10CI job red with no change to Dallilib/andtest/; attribution prefers the location Ruby embeds in the message, since the stack at that point describes the require chain rather than the offending codeKernel#warncallers also required walking the stack rather than indexing it (Ruby 3.3/3.4 push an<internal:warning>frame that 4.0 does not), skipping RubyGems'Kernel#warnshim (active on JRuby but not CRuby), and resolving relative backtrace pathsMake raw and namespace fast path tests actually use those options (#1129)
rawandnamespacevariants passed those options to the helper that starts memcached, which configures the client the tests then discarded, so neither option was ever exercisedBenchmark
set_multiand add adelete_multitarget (#1132)set_multireports that were commented out pending the arrival ofset_multi, resolving the accompanying TODOdelete_multitarget comparing the pipelined path against N single deletesBump CI memcached to 1.6.41 and run benchmarks on pull requests (#1133)
Disable RuboCop metrics cops (#1128)
Remove
PIDCachemodule (#1125)Process.pidis cached natively by Ruby 3.3+ (via https://bugs.ruby-lang.org/issues/19443), making the manual cache unnecessary now that Dalli requires Ruby 3.3+Remove unused
COMPACT_THRESHOLDconstant fromResponseBuffer(#1116)Use
String#byteindexinstead ofString#indexwhen searching for the response terminator ingetk_response_from_buffer(#1112)byteslice;byteindexmakes the intent explicit, though both return the same value since the buffer encoding is alwaysBINARYMake single-server fast path tests actually exercise the fast path (#1127)
single_server_clienttest helper that builds a client with a single address, and uses it in the affectedget_multi,set_multi, anddelete_multitestsConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.